package ebusiness.ebusiness.Controllers;

import ebusiness.ebusiness.Mapper.PathUtil.PagePath;
import ebusiness.ebusiness.Mapper.PathUtil.WebPath;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpSession;

@Controller
public class loginController {
    @RequestMapping(path = WebPath.LOGIN,method = RequestMethod.GET)
    public String Login(){

        return PagePath.LOGIN;
    }
    @RequestMapping(path = WebPath.LOGOUT,method = RequestMethod.GET)
    public String Logout(HttpSession session) {
        int id = -1;
        session.setAttribute("user",id);
        return PagePath.HOMEPAGE;
    }
    @RequestMapping(path = WebPath.REGISTER,method = RequestMethod.GET)
    public String Register(){

        return PagePath.REGISTER;
    }

}
